package com.jincp.common.utils;

import android.graphics.Color;
import android.text.TextPaint;
import android.text.style.ClickableSpan;
import android.view.View;


/**
 * @ProjectName: AyokaClient.
 * @ClassName: SpannableClickable.
 * @Description: .
 * @Author: jincp.
 * @CreateDate: 2019/11/11 16:32.
 */

public abstract class SpannableClickable extends ClickableSpan implements View.OnClickListener {

    /**
     * text颜色
     */
    private int textColor = Color.DKGRAY;

    public SpannableClickable() {
    }

    public SpannableClickable(int textColor){
        this.textColor = textColor;
    }

    @Override
    public void updateDrawState(TextPaint ds) {
        super.updateDrawState(ds);

        ds.setColor(textColor);
        ds.setUnderlineText(false);
        ds.clearShadowLayer();
    }
}
